package com.gopay.common.event.handler;

import java.util.ArrayList;
import java.util.List;

import com.gopay.common.domain.report.Event;

public abstract class EventHandlerGroup {
    
	protected List<EventHandler> handlers =null;

	public void handler(Event e) throws Exception{
	    if(handlers==null){
	        handlers=new ArrayList<EventHandler>();
	        addHandlers();
	    }
	    
	   
		for (EventHandler eh : handlers) {
		    
			eh.handler(e);
		}
	}
	
	public abstract void addHandlers();

}
